//
//  TestViewController.m
//  TNPanNavigationControllerDemo
//
//  Created by TaonanShen on 15/4/14.
//  Copyright (c) 2015年 Tenney. All rights reserved.
//

#import "TestViewController.h"
#import "TNPanNavigationController.h"
#import "OneViewController.h"
#import "TwoTableViewController.h"
#import "ThreeViewController.h"

@interface TestViewController ()

@end

@implementation TestViewController

-(void)loadView{
    
    [super loadView];
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    NSString *title = [NSString stringWithFormat:@"test%ld",self.navigationController.viewControllers.count];
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:nil action:nil];
    if (self.order == 0) {
        self.navigationController.navigationBar.barTintColor = [UIColor orangeColor];
    } else if (self.order == 1) {
        self.navigationController.navigationBar.barTintColor = [UIColor purpleColor];
    } else if (self.order == 2) {
        self.navigationController.navigationBar.barTintColor = [UIColor blueColor];
    }
    self.title = title;
    // Do any additional setup after loading the view.
}
- (IBAction)second:(id)sender {
    
//    TestViewController *testVC = [[TestViewController alloc]initWithNibName:@"TestViewController"
//                                                                     bundle:nil];
//    self.navigationController.navigationBar.barTintColor = [UIColor purpleColor];
//    testVC.order = 2;
//
//    [self.navigationController pushViewController:testVC
//                                         animated:YES];
    
    TwoTableViewController *two = [[TwoTableViewController alloc] init];
    [self.navigationController pushViewController:two animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (IBAction)push:(id)sender {
    OneViewController *one = [[OneViewController alloc] init];
    [self.navigationController pushViewController:one animated:YES];
    
//    TestViewController *testVC = [[TestViewController alloc]initWithNibName:@"TestViewController"
//                                                                     bundle:nil];
//    testVC.order = 1;
//    [self.navigationController pushViewController:testVC
//                                         animated:YES];
    
}

- (IBAction)pop:(id)sender {
//    [(TNPanNavigationController *)self.navigationController popViewControllerWithSelfAnimation:YES];
    
    ThreeViewController *three = [[ThreeViewController alloc] init];
    [self.navigationController pushViewController:three animated:YES];
}
@end
